﻿using System;
using System.IO;
using System.Collections;
using System.Configuration;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Jungle.Code.Core;
using Jungle.Code.DAL;
using System.Collections.Generic;
using Jungle.Code.Utils;
using Jungle.Code.BLL;

using Jungle.News.WebControls;
using Jungle.News;

namespace Jungle.User.Controls
{
    public partial class New : BaseUserModule
	{
        SessionKeeper ts = new SessionKeeper();
        protected override void OnInit(EventArgs e)
        {
            ts.SessionId = Session.SessionID.ToString();
            ts.GetData();

            LoadNew();
            base.OnInit(e);
        }

        protected void LoadNew()
        {
            int NewId = 0;
            if (Request["i"] != null) NewId = Convert.ToInt32(Request["i"]);
            if (NewId != 0)
            {
                NewObject n = new NewObject();
                n.NewId = NewId;
                n.GetById();

                lb_Title.Text = n.PubDate.ToShortDateString() + "  " + n.Title;
                lb_Description.Text = n.Description;
            }
        }        
	}
}